<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
<style>
	.tou {
			display: -webkit-box;
			/*border: 1px solid;*/
			/*width: 100%;*/
			height: 80px;
			-webkit-box-align: center;
			background-color: #0097FF;
		}
		
		.Hui-iconfont {
			display: -webkit-box;
			margin-left: 20px;
			font-size: 30px;
			color: white;
		}
		
		.dd-div {
			/*border: 1px solid;*/
			font-weight: bolder;
			font-size: 25px;
			color: white;
			-webkit-box-flex: 1;
			display: -webkit-box;
			margin-left: ;
			-webkit-box-pack: center;
		}
		.xinxi{
			display: -webkit-box;
			-webkit-box-orient: vertical;
			-webkit-box-align: center;
			
		}
		.xinxi div{
					display: -webkit-box;
			margin-top: 20px;
			width: 100%;
			-webkit-box-pack: center;
			
		}
		#username, #email, #pwd{
			display: -webkit-box;
			width: 100%;
			height: 40px;
			-webkit-box-flex: 1;
			text-align:center;
			
		}
		#login{
			width: 200px;
			height: 40px;
			font-size: 15px;
			font-weight: bold;
			background-color: #04BE02;
			color: white;
			border: 0px;
		}
</style>
	<body>
		<div class="tou">
			<div><a href="../denglu/denglu.html" style="text-decoration: none;"><i class="Hui-iconfont">&#xe67d</i></a></div>
			<div class="dd-div">
				<div class="ding-dan">注册</div>
			</div>
			
		</div>
		<div class="xinxi">
		<div><input type="text" id="username" placeholder="用户名"/></div>
		<div><input type="email" id="email" placeholder="邮箱"/></div>
		<div><input type="password" id="pwd" placeholder="密码"/></div>
		<div><input type="button" value="注册" id="login" onclick="reg()" /></div>
		</div>
		<script src="//cdn1.lncld.net/static/js/2.1.2/av-min.js"></script>
				<link rel="stylesheet" href="js/1.0.8/iconfont.min.css">
		<script>
			window.onload = function() {
				// 初始化存储 SDK
				var APP_ID = 'hMxRNdIevDj4IR3LHG0vJRNU-gzGzoHsz';
				var APP_KEY = 'e7oBIWOnxaDwD5yTBBRUdN4t';
				AV.init({
					appId: APP_ID,
					appKey: APP_KEY
				});
			};

			function reg() {
				var username = document.getElementById("username").value;
				var email = document.getElementById("email").value;
				var pwd = document.getElementById("pwd").value;
				// 新建 AVUser 对象实例
				var user = new AV.User();
				// 设置用户名
				user.setUsername(username);
				// 设置密码
				user.setPassword(pwd);
				// 设置邮箱
				user.setEmail(email);
				user.signUp().then(function(loginedUser) {
					location.href = "../denglu/denglu.html"
						//					console.log(loginedUser);
				}, function(error) {
					alert("邮箱被占用")
				});
			}
			//邮件验证
			AV.User.requestEmailVerify('email').then(function(result) {
				console.log(JSON.stringify(result));
			}, function(error) {
				console.log(JSON.stringify(error));
			});
			
			
		</script>
	</body>

</html>